ZIP := pykemon.zip
EGG := pykelib-$(shell python -mpykelib "print pykelib.__version__").egg
PYGAME_EGG := pygame-1.7.1release-py2.4-linux-i686.egg
PYRO_EGG := Pyro-3.7-py2.4.egg

$(EGG): setup.py $(wildcard pykelib/*.py) $(wildcard pykelib/data/*/*) $(wildcard pykelib/data/*/*/*)
	sudo python setup.py bdist_egg
	cp build/$(EGG) .

$(ZIP): pykemon.pyw pykemon_config.py setup.py README.txt INSTALL.txt $(EGG) $(PYGAME_EGG) $(PYRO_EGG)
	cd ..; zip $(ZIP) $(foreach FILE,$?,pykemon/$(FILE))
	mv ../$(ZIP) .

egg: $(EGG)

default: $(ZIP)

install:
	sudo python setup.py install

clean:
	-rm -f $(ZIP)
	sudo python setup.py clean

.PHONY: clean egg default install
